package bawei.com.bilibili;

import android.content.Intent;

import android.os.Bundle;


import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;



import android.support.v7.widget.Toolbar;



import android.view.View;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;

/**
 * 类描述:
 * 作者：cwm
 * 时间:2017/3/19 19:23
 * 邮箱:18310832074@163.com
 */

public class WebViewActivity extends FragmentActivity {



    private WebView webView;
    private Toolbar toolbar;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.item_webview);
        webView = (WebView) findViewById(R.id.web);
        toolbar = (Toolbar) findViewById(R.id.toolbar);
        //得到web设置属性对象
        WebSettings settings = webView.getSettings();
        //web是否支持js
        settings.setJavaScriptEnabled(true);
        webView.setWebChromeClient(new WebChromeClient());
        toolbar.setLogo(R.drawable.action_button_back_pressed_light);
        toolbar.setTitle(getIntent().getStringExtra("title"));
        webView.loadUrl(getIntent().getStringExtra("web"));


    }
}
